///
/// This method updates a record in the table.
///
public static void UpdateRecord()
{
// Get an existing record with ID 1.Set second parameter to true
// in GetRecord() to retrieve an updatable record.
${${Table Name}RecordClassName} rec = ${${Table Name}ClassName}.GetRecord("1", true );
// Update the fields of the record as shown below.
// EmployeesRecord.LastName = "LastName";
// EmployeesRecord.FirstName = "FirstName";
// Save the update.
rec.Save();
// Example shown below shows the transaction handling.
// Note that you need to start a transaction before calling
// UpdateRecord() function.
// try
// {
// DbUtils.StartTransaction();
// UpdateRecord();
// DbUtils.CommitTransaction();
// this.${Table Name}TableControl.DataChanged = true;
// }
// catch(Exception ex)
// {
// DbUtils.RollBackTransaction();
// BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(this, "UNIQUE_SCRIPTKEY", ex.Message);
// }
// finally
// {
// DbUtils.EndTransaction();
// }
}
|